﻿<%@ Page Language="c#" CodeBehind="NewDocument.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.UnitiveDocument.DocumentFlowPages.NewDocumentPage" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
  <title>NewDocument</title>
  <uds:Style runat="server" Href="~/css/BasicLayout.css" />
  <style type="text/css">
    .headerRow td { padding-top: 6px; padding-bottom: 6px; font-weight: bold; }
  </style>
</head>
<body>
  <form id="NewDocument" method="post" enctype="multipart/form-data" runat="server">
    <div class="commonBg" style="height: 28px; line-height: 28px; vertical-align: middle; text-align: center;">
      <%= GetHeadline() %>
    </div>
    <table class="fixedTable" style="width: 100%;">
      <colgroup>
        <col style="width: 200px;" />
        <col style="width: 100%;" />
      </colgroup>
      <asp:Repeater runat="server" ID="fieldRepeater">
        <ItemTemplate>
          <tr>
            <td class="formlabel"><%# HttpUtility.HtmlEncode(((FlowStyleDescription)Container.DataItem).Description) %> </td>
            <td>
              <asp:TextBox runat="server" ID="fieldValue" Width="<%# ((FlowStyleDescription)Container.DataItem).Width %>" Height="<%# ((FlowStyleDescription)Container.DataItem).Height %>" TextMode="<%# ((FlowStyleDescription)Container.DataItem).Multiline ? TextBoxMode.MultiLine : TextBoxMode.SingleLine %>" Text="<%# GetFieldValue((FlowStyleDescription)Container.DataItem) %>" CssClass="input3" />
              <%# HttpUtility.HtmlEncode(((FlowStyleDescription)Container.DataItem).Example) %>
              <asp:RequiredFieldValidator runat="server" ControlToValidate="fieldValue" Enabled="<%# Container.ItemIndex == 0 || ((FlowStyleDescription)Container.DataItem).Judged %>" ErrorMessage="(*)" CssClass="errorMsg" Display="Dynamic" EnableClientScript="true" />
              <asp:RegularExpressionValidator runat="server" ControlToValidate="fieldValue" ValidationExpression="^\s*\d+\s*$" Enabled="<%# ((FlowStyleDescription)Container.DataItem).Judged %>" ErrorMessage="填写数字" CssClass="errorMsg" Display="Dynamic" EnableClientScript="true" />
            </td>
          </tr>
        </ItemTemplate>
      </asp:Repeater>
      <asp:Repeater runat="server" ID="attachmentRepeater">
        <ItemTemplate>
          <tr>
            <td class="formlabel">附件 </td>
            <td><asp:HyperLink runat="server" Text="<%# ((DocumentFile)Container.DataItem).FileName %>" NavigateUrl="<%# Utility.CombineVirtualDirs(((DocumentFile)Container.DataItem).FileVisualPath, ((DocumentFile)Container.DataItem).FileName)  %>" /> </td>
          </tr>
        </ItemTemplate>
      </asp:Repeater>
      <tr runat="server" id="templateRow" visible="false">
        <td class="formlabel">上传附件</td>
        <td>
          <asp:FileUpload runat="server" ID="fileUpload" CssClass="longInput" />
          <a href="<%= CurrentFlowStyle.TemplateFullVirtualPath %>">（模板下载）</a> </td>
      </tr>
      <tr runat="server" id="projectRow" visible="false">
        <td class="formlabel">请选择所属项目</td>
        <td>
          <asp:DropDownList runat="server" ID="ddlProject" CssClass="Input3" />
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="padding-top: 20px; padding-bottom: 20px;">
          <asp:Button ID="cmdSave" AccessKey="S" runat="server" CssClass="buttoncss" EnableViewState="False" Text="保存" />
          <asp:Button ID="cmdSend" AccessKey="T" runat="server" CssClass="buttoncss" EnableViewState="False" Text="发送" />
          <asp:Button ID="cmdDelete" AccessKey="D" runat="server" CssClass="ButtonCss" EnableViewState="False" Text="删除" CausesValidation="False" />
          <uds:RedirectButton ID="cmdReturn" runat="server" CssClass="ButtonCss" Text="返回" RedirectUrl="DraftList.aspx" />
        </td>
      </tr>
    </table>
    <asp:Repeater runat="server" ID="postilRepeater">
      <HeaderTemplate>
        <table class="fixedTable borderTable" style="width: 100%; background-color: #e8f4ff;">
          <colgroup>
            <col style="width: 100px;" />
            <col style="width: 150px;" />
            <col style="width: 100px;" />
            <col style="width: 70%;" />
            <col style="width: 30%;" />
            <col style="width: 100px;" />
          </colgroup>
          <tr>
            <td colspan="6" class="commonBg" style="height: 28px; line-height: 28px; vertical-align: middle; text-align: center;">审批意见</td>
          </tr>
          <tr class="headerRow">
            <td>批阅人</td>
            <td>批阅时间</td>
            <td>批阅类型</td>
            <td>批阅内容</td>
            <td>附件</td>
            <td>用时（分）</td>
          </tr>
      </HeaderTemplate>
      <ItemTemplate>
        <tr>
          <td><%# HttpUtility.HtmlEncode( ((DocumentPostil)Container.DataItem).Author ) %></td>
          <td><%# Utility.FormatDateTime( ((DocumentPostil)Container.DataItem).TimeCreated ) %></td>
          <td><%# Utility.GetEnumDisplayName( ((DocumentPostil)Container.DataItem).Type ) %></td>
          <td><%# HttpUtility.HtmlEncode(((DocumentPostil)Container.DataItem).Content) %></td>
          <td><%# FormatPostilAttachmentLink((DocumentPostil)Container.DataItem)%></td>
          <td><%# ((DocumentPostil)Container.DataItem).TimeConsumed %></td>
        </tr>
      </ItemTemplate>
      <FooterTemplate>
        </table>
      </FooterTemplate>
    </asp:Repeater>
  </form>
</body>
</html>
